thread = love.thread.getThread()
print(thread)
require "wx"

frame=nil
function createWin()
xpcall(function()
	frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua Minimal Demo",
					   wx.wxDefaultPosition, wx.wxSize(256, 450),
					   wx.wxDEFAULT_FRAME_STYLE)

	-- create a simple file menu
	--[[
	local fileMenu = wx.wxMenu()
	fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program")
	]]

	-- create a menu bar and append the file and help menus
	--[[
	local menuBar = wx.wxMenuBar()
	menuBar:Append(fileMenu, "&File")
	frame:SetMenuBar(menuBar)
	]]
	
	--[[
	local tree = wx.wxTreeCtrl(frame, wx.wxID_ANY, wx.wxDefaultPosition,wx.wxSize(200,400), wx.wxTR_DEFAULT_STYLE, wx.wxDefaultValidator, "wxTreeCtrl")
	local root = tree:AddRoot("_G", -1, -1, wx.NULL)
	for k,v in pairs(_G) do
		tree:AppendItem(root, k.." = "..tostring(v), -1, -1, wx.NULL)
	end
	
	frame:AddChild(tree)
	]]
	
	-- create a simple status bar
	--frame:CreateStatusBar(1)
	--frame:SetStatusText("Welcome to wxLua.")

	-- connect the selection event of the exit menu item to an
	-- event handler that closes the window
	--[[
	frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED,
				  function(event) frame:Close(true) end )
	]]
	frame:Show(true)
	
	print("Starting app loop")
	wx.wxGetApp():MainLoop()
	print("Ending app loop")
end,function(err)
	print(err)
end)
end
createWin()
